package org.shj.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope //需要加入 spring-boot-starter-actuator 的依赖
public class ConfigClientController {

	@Value("${user.default.name}") //user.default.name 为Git 仓库中配置文件中的 一个key
	private String defaultName;
	
	@GetMapping("/defaultName")
	public String hello(){
		return "hello " + this.defaultName;
	}
}
